import { NgModule } from '@angular/core';
import { RouterModule, Routes } from '@angular/router';
import { TabsPage } from './tabs.page';
import { LoginGuard } from '@guard/loginGuard';

const routes: Routes = [
  {
    path: '',
    component: TabsPage,
    children: [
      {
        path: 'home',
        loadChildren: () => import('../pages/home/home.module').then(m => m.HomePageModule),
        canActivate:[LoginGuard]
      },
      {
        path: 'myCredit',
        loadChildren: () => import('../pages/mycredit/mycredit.module').then(m => m.MycreditPageModule),
        canActivate:[LoginGuard]
      },
      {
        path: 'myAccount',
        loadChildren: () => import('../pages/myaccount/myaccount.module').then(m => m.MyaccountPageModule),
        canActivate:[LoginGuard]
      },
    ]
  },
  {
    path: '',
    redirectTo: '/tabs/home',
    pathMatch: 'full'
  }
];

@NgModule({
  imports: [RouterModule.forChild(routes)],
  exports: [RouterModule]
})
export class TabsPageRoutingModule {}
